@extends('layouts.header')
@section('title','提现')


<input id="mobile" type="hidden" value="13812312312"><!-- 这放手机号 -->
<input id="zongMoney" type="hidden" value="520"><!-- 此处放总钱数 -->


<div class="withdraw">
    <div class="withdrawTitle">提现至：微信-零钱</div>
    <div class="shuruMoneyArea">
        <div class="shuruMoneyAreaTitle">提现金额（元）</div>
        <div class="shurimoner"><span>¥</span><input id="money" oninput="inputChange(this)" type="number" value=""></div>
        <div class="zongjiner" id="can" >可提现金额：{{$canFee}}</div>
    </div>
    <input style="display: none;" maxlength="11" name="phone" value="{{$user['phone']}}" type="text"
           placeholder="请输入手机号">
    <div class="aynzmaCode">

        <input  name="code"   type="text" placeholder="请输入验证码">
        <button  id="sms">获取验证码</button>
    </div>
    <div class="sub">
        <button id="submitBtn">确认提现</button>
    </div>
    <div class="tixianguize">
        <div class="tixianguizeTitle">提现规则：</div>
        <div class="tixinDetail">
            <p>最少提现金额为 ¥500</p>
        </div>
    </div>
</div>
<form id="form" action="{{route('vendor.withdrawAudit')}}" method="post">
    {{ csrf_field() }}
    <input id="fee" type="hidden" name="fee" value="">
    <input id="canFee" type="hidden" name="canFee" value="{{$canFee}}">
</form>

@push('js')
    <script>
        var obj = new MyObj();

        function MyObj() {
            this.malfunction = 1;			// 故障状态码
        }
        $("#submitBtn").click(function () {
            var money = $('#money').val();
            var can = $('#can').val();
            $('#canFee').val(can);
            $('#fee').val(money);
            if (money == null || money == undefined) {
                mui.alert("请填写提现金额", "提示", "确认");
                return false;
            }
            if (money < 500) {
                mui.alert("提现金额必须大于500元", "提示", "确认");
                return false;
            }
            if (money > can) {
                mui.alert("提现金额不可大于可提现金额", "提示", "确认");
                return false;
            }
            $('#form').submit();
            return false;

        });
    </script>
@endpush
